package clone;

public class Person implements Cloneable{
    private Address address;

    public Person(Address address) {
        this.address = address;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    @Override
    public Person clone() {
        try {
            Person clone = (Person) super.clone();
            clone.setAddress(clone.getAddress().clone());
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new AssertionError();
        }
    }

    public static void main(String[] args) {
//        Person Person1 = new Person(new Address("巢都"));
//        Person Person1Copy = Person1.clone();
////false
//        System.out.println(Person1 == Person1Copy);
////false
//        System.out.println(Person1.getAddress() == Person1Copy.getAddress());
        String s = "<think>\\n\\n</think>\\n\\n浏览器是用于访问和查看互联网资源的软件应用程序。常见的浏览器包括：\\n\\n";
        s = s.replace("\\n",";");
        System.out.println(s);
    }
}
